import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import {AuthGuard} from "../../service/authGuard";
import {RiskReportDetailComponent} from "./risk-report-detail/risk-report-detail.component";


const routes: Routes = [
  {path: "", redirectTo: "list", pathMatch: "full"},
  {
    path: "list",
    component: RiskReportDetailComponent,
    canActivate: [AuthGuard],
    data: {
      title: 'RiskReport'
    }
  },
  {
    path: ":id/detail",
    component: RiskReportDetailComponent,
    canActivate: [AuthGuard],
    data: {
      title: 'RiskReportDetail'
    }
  },
  // {path: 'list', loadChildren: './risk-report/risk-report-board.module#RiskReportListBoardModule'},
  // {
  //   path: ":executionId/:subCategory/report/create",
  //   component: RiskReportDetailComponent,
  //   canActivate: [AuthGuard],
  //   data: {
  //     title: 'RiskReportCreate'
  //   }
  // },
  {
    path: ":executionId/:subCategory/report/:action",
    component: RiskReportDetailComponent,
    canActivate: [AuthGuard],
    data: {
      title: 'RiskReportCreate'
    }
  },
  {
    path: ":executionId/:subCategory/report/:action/location/:location",
    component: RiskReportDetailComponent,
    canActivate: [AuthGuard],
    data: {
      title: 'RiskReportCreate'
    }
  },
  {
    path: ":executionId/:subCategory/report/:reportId/update",
    component: RiskReportDetailComponent,
    canActivate: [AuthGuard],
    data: {
      title: 'RiskReportUpdate'
    }
  },
  {
    path: ":executionId/:subCategory/report/:reportId/detail/:type",
    component: RiskReportDetailComponent,
    canActivate: [AuthGuard],
    data: {
      title: 'RiskReportDetail'
    }
  },
  {
    path: ":executionId/:subCategory/report/:action/location/:location/scan/:code",
    component: RiskReportDetailComponent,
    canActivate: [AuthGuard],
    data: {
      title: 'RiskReportCreate'
    }
  }
];

@NgModule({
    imports: [RouterModule.forChild(routes)],
    exports: [RouterModule]
})
export class RiskReportBoardRoutes {
}
